package com.mvc.action;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.mvc.annotation.Controller;
import com.mvc.bean.BaseBean;
import com.mvc.bean.UserBean;

@Controller("addAction")
public class AddAction implements BaseAction {

	@Override
	public String execute(HttpServletRequest request, HttpServletResponse response, BaseBean baseBean,
			Map<String, String> actionForWard) {
		String url = "error";
		UserBean ub = (UserBean) baseBean;
		if (ub != null && ub.getUserName() != null && ub.getPassWord() != null) {
			if ("abc".equals(ub.getUserName())) {
				url = "success";
			}
		}
		return actionForWard.get(url);
	}

}
